import numpy as np
import matplotlib.pyplot as plt

title = "drawtest"

originData = np.genfromtxt("print_debug.txt",delimiter="\t")
datenum = originData.shape[0]
index = np.arange(datenum)
interval = originData[:,1]

fig_1 = plt.figure(figsize=(6,3))
color = interval - 2
plt.scatter(index,interval,s=20,c=color,alpha=.5)
plt.legend(loc='best',labels=[title])
plt.grid(True)
plt.xlabel('time(s)')

filename = title + ".png"
fig_1.savefig(filename,dpi=600,bbox_inches = 'tight')

plt.draw()
plt.pause(3)
plt.close(fig_1)
